import request from '@/utils/request'
const login = (data: any) => {
  return request({
    url: '/login/doLogin',
    method: 'post',
    data,
  })
}
const getCaptchaImage = () => {
  return request({
    url: '/login/getCaptcha',
    method: 'GET',
  })
}

const getUserMuenus = () => {
  return request({
    url: '/admin/getAdminLeftMenuList',
    method: 'POST',
  })
}
const refreshToken = (data: { token: string }) => {
  return request({
    url: '/login/tokenLogin',
    method: 'POST',
    data,
  })
}
//
const logout = () => {
  return request({
    url: '/back/usercenters/logout/',
    method: 'post',
  })
}
const loginApi = {
  login,
  getCaptchaImage,
  getUserMuenus,
  refreshToken,
  logout,
}
export default loginApi
